package day2.线程池.demo1;

import day2.线程池.MyTask;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Test {
    public static void main(String[] args) {
        MyTask t =new MyTask();
        ExecutorService pool = Executors.newFixedThreadPool(1);
        pool = Executors.newCachedThreadPool();
        pool = Executors.newSingleThreadExecutor();
        for (int i = 0; i < 10; i++) {
            pool.submit(t);
        }
        pool.shutdown();
        System.out.println(".....");

    }
}
